% computes root mean square
function [result] = rms(signal)

result = 0;
len = length(signal);
for i=1:len
    result = result + ( signal(i) )^2;
end

result = sqrt ( (1/len) * result);